# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.FirebaseAppDistribution.V1.Model.GdataContentTypeInfo do
  @moduledoc """
  Detailed Content-Type information from Scotty. The Content-Type of the media will typically be filled in by the header or Scotty's best_guess, but this extended information provides the backend with more information so that it can make a better decision if needed. This is only used on media upload requests from Scotty.

  ## Attributes

  *   `bestGuess` (*type:* `String.t`, *default:* `nil`) - Scotty's best guess of what the content type of the file is.
  *   `fromBytes` (*type:* `String.t`, *default:* `nil`) - The content type of the file derived by looking at specific bytes (i.e. "magic bytes") of the actual file.
  *   `fromFileName` (*type:* `String.t`, *default:* `nil`) - The content type of the file derived from the file extension of the original file name used by the client.
  *   `fromHeader` (*type:* `String.t`, *default:* `nil`) - The content type of the file as specified in the request headers, multipart headers, or RUPIO start request.
  *   `fromUrlPath` (*type:* `String.t`, *default:* `nil`) - The content type of the file derived from the file extension of the URL path. The URL path is assumed to represent a file name (which is typically only true for agents that are providing a REST API).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bestGuess => String.t() | nil,
          :fromBytes => String.t() | nil,
          :fromFileName => String.t() | nil,
          :fromHeader => String.t() | nil,
          :fromUrlPath => String.t() | nil
        }

  field(:bestGuess)
  field(:fromBytes)
  field(:fromFileName)
  field(:fromHeader)
  field(:fromUrlPath)
end

defimpl Poison.Decoder, for: GoogleApi.FirebaseAppDistribution.V1.Model.GdataContentTypeInfo do
  def decode(value, options) do
    GoogleApi.FirebaseAppDistribution.V1.Model.GdataContentTypeInfo.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.FirebaseAppDistribution.V1.Model.GdataContentTypeInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
